/**
 * Applikationsutveckling i Java, 5DV135
 * HT12
 * Project
 *
 * File: Zone.java
 * Description: A class representing a zone in a game
 * Date: 18 december 2012
 *
 * cs-user: dv11mgr
 * @author Maria Gramner
 */

package nullInvader.Engine;
import java.util.ArrayList;
import java.util.List;


public class Zone {

    private Field brick;
    private List<Unit> unitList;

    /**
     * Constructor. Sets the type of brick for the zone
     * and creates a new list for storing units in
     * @param brick Field.
     */
    public Zone(Field brick){
        this.brick = brick;
        unitList = new ArrayList<Unit>();
    }


    /**
     * Method to return the current brick for the zone
     * @return Field
     */
    public Field getBrick(){
        return brick;
    }


    /**
     * Method to set the tile for the zone.
     * @param tile Field.
     */
    public void setBrick(Field tile){
        brick = tile;
    }


    /**
     * Method to get the list of units currently in the zone
     * @return List<Unit>
     */
    public List<Unit> getUnitList ( ){
        return unitList;
    }


    /**
     * Method to add a unit to the zone
     * @param unit Unit.
     * @return List<Unit>
     */
    public List<Unit> addUnit(Unit unit){
        unitList.add(unit);
        return unitList;
    }


    /**
     * Method to remove a unit from the zone
     * @param unit Unit.
     * @return List<Unit>
     */
    public List<Unit> removeUnit(Unit unit){
        unitList.remove(unit);
        return unitList;
    }
}
